package com.george.testweb.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by hu on 2017-05-16.
 */
@Controller
public class IndexController {

    @RequestMapping
    public ModelAndView index() {
        ModelAndView mv = new ModelAndView();

        List<Integer> list = new ArrayList<Integer>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);

        mv.addObject("user", "george");
        mv.addObject("list", list);
        mv.setViewName("index");
        return mv;
    }
}
